<template>
  <div>
    <el-card :body-style="{padding:'15px'}" shadow="never">
      <el-radio-group v-model="activeName" size="medium">
        <el-radio-button :label="1" v-if="$permiss[1474]">{{ $t('团队数据') }}</el-radio-button>
        <el-radio-button :label="0">{{ $t('个人数据') }}</el-radio-button>
      </el-radio-group>
      <el-select style="width:200px;margin-left: 15px" :placeholder="$t('请选择APP')" clearable v-model="productName"
      >
        <el-option v-for="item in productList" :key="item.productId" :label="item.appName"
                   :value="item.productName"></el-option>
      </el-select>
      <el-select style="width:200px;margin-left: 15px" :placeholder="$t('角色名称')" v-model="type"
                 v-if="activeName === 1"
      >
        <el-option :label="$t('初审专员')" :value="1"></el-option>
        <el-option :label="$t('终审专员')" :value="2"></el-option>
      </el-select>
    </el-card>
    <div style="margin-top: 15px">
      <PersonalData v-if="activeName === 0" :productName="productName"/>
      <TeamData v-else :productName="productName"/>
    </div>
  </div>
</template>

<script>
import PersonalData from "./personalData"
import TeamData from "./teamData"
import {selectProduct} from "@/api/system";

export default {
  name: "index",
  components: {
    PersonalData,
    TeamData
  },
  data() {
    return {
      activeName: 0,
      productList: [],
      productName: null,
      type: 1
    }
  },

  mounted() {
    if (this.$permiss[1474]) {
      this.activeName = 1
    } else {
      this.activeName = 0
    }
    selectProduct().then(res => {
      this.productList = res.data
    })
  },
  methods: {}
}
</script>

<style scoped>

</style>
